package com.qinggeng.project.api.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.qinggeng.common.constant.UserConstants;
import com.qinggeng.common.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.util.Date;


@Data
@ApiModel("评价信息")
public class GoodsEvaluateDto {

    private  Long userId;

    private Long ordersId;

    private Long goodsId;
    //用户头像
    private String userAvatar;
    //用户名称
    private String userName;

    /** 商品质量 */
    private Long goodsQuality;

    /** 配送服务 */
    private Long distService;

    /** 评价图片 */
    private String evaluateImgs;

    /** 评价描述 */
    private String evaluateDesc;

    //评价时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    public String getUserAvatar() {
        if (StringUtils.isEmpty(this.userAvatar)){
            return UserConstants.DEFAULT_AVATAR;
        }else{
            return userAvatar;
        }
    }

    public void setUserAvatar(String userAvatar) {
        this.userAvatar = userAvatar;
    }
}
